<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>

<script>
    var date = new Date();
    document.write("date=" + date + "<br>");
    document.write("toLocaleString=" + date.toLocaleString() + "<br>");
    document.write("getTime=" + date.getTime() + "<br>");//获取时间戳
</script>
</html>